package www.sofn.com.area;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import www.sofn.com.area.domain.vo.AreaVO;
import www.sofn.com.domain.R;

import java.util.List;

@RestController
@Tag(name = "行政区")
@RequestMapping("area")
public class AreaController {

    @Resource
    private AreaService service;
    @Operation(summary = "获取热门商品")
    @GetMapping
    public R<List<AreaVO>> findByParentId(@RequestParam(name = "parentId" ,required = false) Integer parentId){
     return    R.ok(service.findByParentId(parentId));
    }
}
